package com.ftg.learn.controller;

import com.ftg.learn.dao.Dept;
import com.ftg.learn.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class DeptController {

    @Autowired
    DeptService ds;

    @GetMapping("/showall")
    public Map<String,Object>  showAll(){
        Map<String,Object> map=new HashMap<>();
        List<Dept> list = ds.showAll();

        map.put("data", list);

        map.put("code", "0");


        return map;
    }
}
